home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / mvwin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.4 KB  |  59 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    mvwin
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_mvwin = "$Header: C:\CURSES\portable\RCS\mvwin.c 2.1 1993/06/18 20:20:24 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   mvwin()    - move window
  15.  
  16.   X/Open Description:
  17.      
  18.  
  19.   PDCurses Description:
  20.      There is no additional PDCurses functionality.
  21.  
  22.   X/Open Return Value:
  23.      The mvwin() routine returns OK on success and otherwise ERR
  24.      is returned.
  25.  
  26.   PDCurses Errors:
  27.      It is an error to call this function with a NULL window pointer.
  28.      It is also an error to address a position that is outside the
  29.      bounds of the specified window.
  30.  
  31.   Portability:
  32.      PDCurses    int mvwin( WINDOW* win, int y, int x );
  33.      X/Open Dec '88    int mvwin( WINDOW* win, int y, int x );
  34.      BSD Curses    int mvwin( WINDOW* win, int y, int x );
  35.      SYS V Curses    int mvwin( WINDOW* win, int y, int x );
  36.  
  37. **man-end**********************************************************************/
  38.  
  39. int    mvwin(WINDOW *win, int y, int x)
  40. {
  41. #ifdef PDCDEBUG
  42.     if (trace_on) PDC_debug("mvwin() - called\n");
  43. #endif
  44.  
  45.     if (win == (WINDOW *)NULL)
  46.         return( ERR );
  47.  
  48.     if (win->_begy + win->_maxy > LINES)
  49.         return( ERR );
  50.  
  51.     if (win->_begx + win->_maxx > COLS)
  52.         return( ERR );
  53.  
  54.     win->_begy = y;
  55.     win->_begx = x;
  56.     touchwin(win);
  57.     return( OK );
  58. }
  59.